home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / windows / uts60323.zip / UTS60323.EXE / UPLO-UTS.SC_ / UPLO-UTS.SC
Text File  |  1996-11-19  |  2KB  |  84 lines

  1. // A demonstration upload script using dostomapper.
  2. // This demo will need some adjustments to run on your applications.
  3. // In general: To do a upload you need an application to capture 
  4. // the data on the remote host - something that would send all
  5. // incomming data to a file.
  6. // You may also try a crude interactive method, using the Read menu option 
  7. // which may upload a screen full of data at a time to an application
  8. // that gives no responses - just accepts all data.
  9. s5 = "upload.tst"
  10. open s5 0
  11. v0 = 0        // line counter
  12. s2 = "\ee"    // cursor home
  13. s3 = "\eM"    // clear screen
  14. if (ferr == 0)
  15.     send s2
  16.     send s3
  17.     send  "dostomapper "
  18.     send "\e!T"
  19.     wait 400
  20.     send s2
  21.     send s3
  22.     send "\r"
  23.     v9 = 1
  24.     v0 = 0
  25.     v1 = 0                // number to put
  26.     v2 = 1759            // maximum block length to send
  27.     while v9
  28.         if v1==0 && v9 != 2
  29.             s0 = readln(0)
  30.             if ferr != 0
  31.                 v9 = 2
  32.                 v1 = 2
  33.                 s1 = "{f"
  34.             else
  35.                 v1 = len(s0) + 2
  36.                 s1 = "{l"
  37.             endif
  38.         endif
  39.         if v1 && v0+v1 < v2        // room left on screen
  40.             v0 = v0 + v1
  41.             send s0
  42.             send s1
  43.             v1 = 0
  44.         else
  45.             send "\e!T"
  46.             wait 200
  47.             if flags & 1
  48.                 send "\e!U"
  49.                 send s2
  50.                 send s3
  51.                 send "No response from host!"
  52.                 v9 = 0
  53.             else
  54.                 if flags & 2
  55.                     send "\e!U"
  56.                     send s2
  57.                     send s3
  58.                     send "User abort!"
  59.                     v9 = 0
  60.                 else
  61.                     s4 = screen(0,0,2)
  62.                     if match(s4,"  ") == 0
  63.                         display "Bad response from host!"
  64.                         v9 = 0
  65.                     else
  66.                         send s2
  67.                         send s3
  68.                         send "\r"
  69.                         v0 = 0
  70.                         if v1 == 0
  71.                             send "done!"
  72.                             v9 = 0    // done!
  73.                         endif
  74.                     endif
  75.                 endif
  76.             endif
  77.         endif
  78.     endwhile
  79.     close 0
  80. else
  81.     display "Open error on 'upload.tst'"
  82. endif
  83.  
  84.